<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>13-jQuery动画效果之滑动</title>
  <script src="jquery.js"></script>
  <style>
    div {
      width: 150px;
      height: 300px;
      background-color: pink;
      display: none;
    }
  </style>
</head>

<body>
  <button>下拉滑动</button>
  <button>上拉滑动</button>
  <button>切换滑动</button>
  <div></div>
  <script>
    $(function () {
      $("button").eq(0).click(function () {
        // 1. 下滑动
        $("div").slideDown(500);
      })

      $("button").eq(1).click(function () {
        // 2. 上滑动
        $("div").slideUp(500);
      })

      $("button").eq(2).click(function () {
        // 1. 滑动切换
        $("div").slideToggle();
      })
    });
  </script>
</body>

</html>